home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / linuxcon.000 / linuxcon / linuxconf-1.6 / xconf / components.h < prev    next >
C/C++ Source or Header  |  1996-07-31  |  2KB  |  79 lines

  1. #pragma interface
  2. #ifndef COMPONENTS_H
  3. #define COMPONENTS_H
  4.  
  5. /*
  6.     A COMPONENT hold thoses informations
  7.         A manufacturer ID
  8.         A product model ID
  9.         A pointer to a part of a Xconfig applicable to this component.
  10.         A pointer to a notice
  11.         A pointer to an action script
  12. */
  13. #ifndef SECTION_H
  14.     #include "section.h"
  15. #endif
  16. class NOTICE{
  17.     char **tbstr;
  18.     int nbstr;
  19.     int maxstr;
  20.     /*~PROTOBEG~ NOTICE */
  21. public:
  22.     NOTICE (void);
  23.     void add (const char *str);
  24.     int format (char *buf, int maxsiz)const;
  25.     int print (FILE *fout, int indent)const;
  26.     ~NOTICE (void);
  27.     /*~PROTOEND~ NOTICE */
  28. };
  29. class ACTION: public NOTICE{
  30.     /*~PROTOBEG~ ACTION */
  31.     /*~PROTOEND~ ACTION */
  32. };
  33. class COMPONENT: public PAIRES{
  34. public:
  35.     XCONFIG *xconfig;
  36.     NOTICE *notice;
  37.     ACTION *action;
  38.     /*~PROTOBEG~ COMPONENT */
  39. public:
  40.     COMPONENT (const char *manuf_id,
  41.          const char *model_id,
  42.          XCONFIG *_xconfig,
  43.          NOTICE *_notice,
  44.          ACTION *_action);
  45.     /*~PROTOEND~ COMPONENT */
  46. };
  47.  
  48. #include <stdio.h>
  49.  
  50. class COMPONENTS{
  51.     XCONFIG **tb_xconfig;
  52.     int nb_xconfig;
  53.     int max_xconfig;
  54.     NOTICE **tb_notice;
  55.     int nb_notice;
  56.     int max_notice;
  57.     ACTION **tb_action;
  58.     int nb_action;
  59.     int max_action;
  60.     COMPONENT **tb_component;
  61.     int nb_component;
  62.     int max_component;
  63.     /*~PROTOBEG~ COMPONENTS */
  64. public:
  65.     COMPONENTS (void);
  66.     void add (COMPONENT *comp);
  67.     void add (NOTICE *notice);
  68.     void add (XCONFIG *xconf);
  69.     COMPONENT *item (int no);
  70.     void print (FILE *fout);
  71.     int read (const char *fname);
  72.     int setmenu (char *tbopt2[]);
  73.     void sort (void);
  74.     virtual ~COMPONENTS (void);
  75.     /*~PROTOEND~ COMPONENTS */
  76. };
  77.  
  78. #endif
  79.